﻿namespace ReplayDataFile
{
    using System;
    using System.Runtime.CompilerServices;

    public class DataTypeDirEntry
    {
        public DataTypeDirEntry()
        {
            this.Init();
        }

        public void Init()
        {
            this.FirstIndexBlock = -1;
            this.FirstDataBlock = -1;
            this.CurDataBlock = -1;
            this.CurIndexBlock = -1;
            this.DataBlockOffset = 0;
            this.IndexBlockOffset = 0;
            this.DataRecordCount = 0;
            this.IndexRecordCount = 0;
            this.IsWriteIndex = true;
        }

        public override string ToString()
        {
            return string.Format("DataType: 0X{0:X}, FisrtDataBlock:0X{1:X}, FistIndexBlock:0X{2:X}", this.DataType, this.FirstDataBlock, this.FirstIndexBlock);
        }

        public int CurDataBlock { get; set; }

        public int CurIndexBlock { get; set; }

        public int DataBlockOffset { get; set; }

        public byte DataFormat { get; set; }

        public int DataRecordCount { get; set; }

        public long DataRecordTotalBytes { get; set; }

        public int DataType { get; set; }

        public int FirstDataBlock { get; set; }

        public int FirstIndexBlock { get; set; }

        public int IndexBlockOffset { get; set; }

        public int IndexRecordCount { get; set; }

        public bool IsWriteIndex { get; set; }

        public string Name { get; set; }

        public static int Size
        {
            get
            {
                return 0x100;
            }
        }

        public int TotalRecordFromStartup { get; set; }

        public int ToWriteCount { get; set; }
    }
}

